<template>
    <div style="height:100%">
      <ly-tab class="fixed" v-model="selectedId" :items="items" :options="options" @change="handleChange"></ly-tab>
      <router-view></router-view>
    </div>
</template>

<script>
export default {
    name:"Home",
    data(){
        return{
            selectedId:0,   //选中id
            items:[
                {label:'热门'},
                {label:'服饰'},
                {label:'鞋包'},
                {label:'百货'},
                {label:'食品'},
                {label:'内衣'},
                {label:'男装'},
                {label:'电器'}
            ],
            options:{
                activeColor:'#e9232c' //设置选中颜色
            },
            //二级路由路径
            subRouterUrl:[
                "/home/hot",
                "/home/fushi",
                "/home/xiebao",
                "/home/baihuo",
                "/home/shipin",
                "/home/neiyi",
                "/home/nanzhuang",
                "/home/dianqi"
            ]

        }
    },
    methods:{
        handleChange(item,index){
            this.$router.replace(this.subRouterUrl[index])
        }
    }
}
</script>

<style scoped lang="stylus" ref="stylesheet/stylus">
    .fixed{
        position fixed
        top:0
    }
</style>